package com.hello_android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class Multiplication extends Activity {
	
	public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_multiplication);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_multiplication, menu);
        return true;
    }
    
    /** Called when the user clicks the Send button */
  public void sendMessage(View view) 
  {
  	Intent intent = new Intent(this, DisplayMessageActivity.class);
  	EditText VariableB = (EditText) findViewById(R.id.VariableB);
  	EditText VariableA = (EditText) findViewById(R.id.VariableA);
  	int mult = Integer.parseInt(VariableA.getText().toString()) * Integer.parseInt(VariableB.getText().toString()) ;
//  	String message = VariableA.getText().toString();
  	intent.putExtra(EXTRA_MESSAGE, Integer.toString(mult));
  	startActivity(intent);
  }
}
